/*""FILE COMMENT""***********************************************************
 *  System Name	     	: DC BrashLess Motor Control
 *  File Name    	  	: Uart.c
 *  Version        	 	: Ver 1.00
 *  Contents      	 	: 
 *  CPU          	 	: STM32F030C6T6
 *  Compiler     	   	: ARM-MDK-KeilUv5
 *  OS            	 	: STM32F0
 *  Programmer	     	: XuGuang design E-Bike software workshop
 *""FILE COMMENT END""******************************************************/
        
#include "py32f0xx_hal.h"
#include "type_def.h"

UART_HandleTypeDef UartHandle;

#if SET_UART2
void Uart2_Init(void)                                                                                                                                                                                                                                                                                                                                                                                  
{   
	USART2->BRR = 0x5E;	//24M/256000bps=0x5E	//(24000000+57600/2)/57600 = 0x1A1;	//57600bps
	USART2->CR1 = 0x200C;
	USART2->CR3 = 0x0001;
}                                   

int fputc(int ch, FILE *f)
{
	
	USART2->DR = ch;
	while(!(USART2->SR & 0x0040));
	return ch;
}
#else

#endif

void Uart1_Init(void)                                                                                                                                                                                                                                                                                                                                                                                  
{//Int Rx/DMA Tx(DMA1-CCR1)   

}  

void USART1_IRQHandler(void)
{

}



		

